const userService = require("./user.service");

class UserController {

    async queryUserList(ctx) {
       ctx.body = await userService.queryUserList(ctx.request.query);
    }
    async createUser(ctx) {
       ctx.body = await userService.createUser(ctx.request.body, ctx.state);
    }

    async createShop(ctx) {
        ctx.body = await userService.createShop(ctx.request.body, ctx.state);
    }
    async updateShop(ctx) {
        ctx.body = await userService.updateShop(ctx.request.params.id, ctx.request.body, ctx.state);
    }
    async queryTenants(ctx) {
        ctx.body = await userService.queryTenants();
    }
    async setUserTenant(ctx) {
        ctx.body = await userService.setUserTenant(ctx.request.params, ctx.request.body);
    }


	async queryGroupList(ctx) {
        ctx.body = await userService.queryGroupList(ctx.query);
	}
	async queryGroupMembers(ctx) {
        ctx.body = await userService.queryGroupMemberList(ctx.state);
	}
	async setAvatarName(ctx) {
        ctx.body = await userService.setAvatarName(ctx.request.body, ctx.state);
	}
    async getScanFamilySign(ctx) {
        ctx.body = await userService.getScanFamilySign(ctx.state);
	}
    async familyScanJoin(ctx) {
        ctx.body = await userService.familyScanJoin(ctx.request.body);
	}
    async getFamilyScanCode(ctx) {
        ctx.body = await userService.getFamilyScanCode(ctx.request.body, ctx.state);
	}
    async createFamilyGroup(ctx) {
        ctx.body = await userService.createFamilyGroup(ctx.request.body, ctx.state);
	}
    async deleteFamilyGroup(ctx) {
        ctx.body = await userService.deleteFamilyGroup(ctx.params.id, ctx.state);
	}
    async getFamilyInvitationNumber(ctx) {
        ctx.body = await userService.getFamilyInvitationNumber(ctx.state);
	}
    async familyInputJoin(ctx) {
        ctx.body = await userService.familyInputJoin(ctx.params.code, ctx.state);
	}
}

module.exports = new UserController();
